/*
 * @Descripttion: 写点什么
 * @version: 
 * @Author: Zhaocy
 * @Date: 2024-07-31 10:14:08
 * @LastEditors: Zhaocy
 * @LastEditTime: 2024-07-31 13:04:43
 */
package com.zhike.service.resource.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.eva.epc.common.util.CommonUtils;
import com.zhike.mapper.resource.ResourceMapper;
import com.zhike.service.resource.IResourceService;

@Service
public class ResourceServiceImpl implements IResourceService {

  @Resource
  private ResourceMapper resourceMapper;

  @Override
  public Boolean insertUsersBinary(String userUid, Boolean usedForPhoto, String resFileName, Long resSize) {
    return resourceMapper.insertUsersBinary(userUid,
        usedForPhoto ? "0" : "1",
        resFileName,
        CommonUtils.getConvenientFileSize(resSize, 2),
        resSize) > 0;
  }

  @Override
  public Boolean increaseBinaryViewCount(String resFileName) {
    return resourceMapper.increaseBinaryViewCount(resFileName) > 0;
  }

}
